(define (make-queue)
    (cons `() `())
)
(define (set-front-ptr! queue item)
    (set-car! queue item)
)
(define (set-rear-ptr! queue item)
    (set-cdr! queue item)
)

(define (front-ptr queue) (car queue))
(define (rear-ptr queue) (cdr queue))
(define (empty-queue? queue) (null? (front-ptr queue)))
(define (insert-queue! queue item)
    (let 
        ((new-pair (cons item `())))
        (cond 
            ((empty-queue? queue)
                (set-front-ptr! queue new-pair)
                (set-rear-ptr! queue new-pair)
                queue
            )
            (else
                (set-cdr! (rear-ptr queue) new-pair)
                (set-rear-ptr! queue new-pair)
                queue
            )
        )
    )
)
(define (delete-queue! queue)
    (cond 
        ((empty-queue? queue)
            (error "DELETE empty queue" queue)
        )
        (else
            (set-front-ptr! queue (cdr (front-ptr queue)))
            queue
        )
    )
)

(define (print-queue queue)
    (newline)
    (display "queue:")
    (display (front-ptr queue))
)

(define q1 (make-queue))
(insert-queue! q1 `a)
(print-queue q1)
(insert-queue! q1 `b)
(print-queue q1)
(delete-queue! q1 )
(print-queue q1)
(delete-queue! q1 )
(print-queue q1)
(exit)